import http from '@/server/index';
/**
 * 获取json数据库分页列表
 * @param params 
 * @returns 
 */
export function getDBListPageApi(params: GetDBListPage.Request) {
    return http.get<any, Result<GetDBListPage.Response>>('/root/getDBListPage', { params });
}
/**
 * 新增json数据库一条数据
 * @param params 
 * @returns 
 */
export function addDBList(params: AddDBList.Request) {
    return http.post<any, Result<null>>('/root/addDBList', params);
}
/**
 * 根据uId查询表数据详情
 * @param params 
 * @returns 
 */
export function getDBListDetail(params: GetDBListDetail.Request) {
    return http.get<any, Result<GetDBListDetail.Response>>('/root/getDBListDetail', { params });
}
/**
 * 根据uId查询表数据详情
 * @param params 
 * @returns 
 */
export function updateListDetail(params: UpdateListDetail.Request) {
    const { uId, ...left } = params
    return http.put<any, Result<null>>('/root/updateListDetail', left, {
        params: { uId }
    });
}
/**
 * 根据uId删除表数据
 * @param params 
 * @returns 
 */
export function removeDBListById(params: RemoveDBListById.Request) {
    return http.delete<any, Result<null>>('/root/removeDBListById', { params });
}
/**
 * 新增表中Attribute属性名
 * @param params 
 * @returns 
 */
export function addRootAttribute(params: AddRootAttribute.Request) {
    return http.post<any, Result<null>>('/root_attribute/addRootAttribute', params);
}